{% extends 'base.html' %}
{% block title %}帖子标题{% endblock %}


{% block head %}
    <link rel="stylesheet" href="{{ url_for('static', filename='css/detail.css') }}">
{% endblock %}


{% block main %}
    <h2 class="page-title">{{ post.title }}</h2>
    <p class="post-info">
        <span class="post-author">作者:{{ post.author.username }}</span>
        <span>时间:{{ post.time }}</span>
    </p>
    <hr>
    <p class="post-content">{{ post.content }}</p>
    <hr>
    <h4>评论(0)</h4>
    <form action="#" method="post">
        <div class="form-group">
            <input type="text" class="form-control" placeholder="评论内容" name="content">
        </div>
        <div class="form-group">
            <button class="btn btn-primary">发表评论</button>
        </div>
    </form>
    <ul class="comment-list">
        {% for comment in post.comments %}
            <li>
                <div class="user-info">
                    <span class="comment-username">{{ comment.author.username }}</span>
                    <span class="comment-time">{{ comment.time }}</span>
                </div>
                <p class="comment-content">{{ comment.content }}</p>
            </li>
        {% endfor %}
    </ul>
{% endblock %}